var http = require('http');

var server = http.createServer();

server.on('request',function (req,res) {
   //1.通过 req.url 获取当前路径
    var url = req.url

    //2.根据不同的请求路径，处理不同的的响应
    if (url==='/'){
        res.end('<h2>index page</h2>')
    }else if (url==='/login'){
        res.end('longin page')
    }else if (url==='/register'){
        res.end('regiser page')
    }else {
        res.end('404 Not Found')
    }
});

server.listen(3000,function () {
    console.log('running...................')
});













